home *** CD-ROM | disk | FTP | other *** search
- NameExample.e By Edward Farrow
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- First of all, we create an area of memory that the user can play in. This
- I have called 'moo'.
-
- DEF moo[256]:STRING
- ^Type - STRING allows you to use `\s' later on.
- ^Bytes - The size in which to make it.
- ^Name - The area name.
- ^Define - E keyword.
-
- Now we display the message, leaving off the `\n' so that we can display a
- decent prompt.
-
- WriteF('What Is Your Name? ')
-
- - Notice The space after `?' this allows us to have an easy to
- read line for the user.
-
- Next we read the user input. This should be quick and easy not needing to
- load any modules!
-
- ReadStr(stdout,moo)
- ^Where To - Area of memory/buffer we have made
- ^Where From - The place to read from (could be a file)
- ^Command - The E command.
-
- Once this is done it is a simple case of displaying the name on the screen.
-
- WriteF('Your Name Is \s\n',moo)
-
- \s = moo - the earlier string we defined as moo containing
- the result from ReadStr.
-
-
-